// 获取编辑表单
import request from '@/utils/request'

export function getPlatFormAddonList(page = 0, size = 10, search, plaid) {
  return request({
    url: '/platform/addon/index',
    method: 'post',
    data: { page, size, search, plaid }
  })
}

export function getPlatformAddonForm(id = 0, plaid, is_admin = 0) {
  return request({
    url: '/platform/addon/getPlatformAddonForm',
    method: 'post',
    data: { id, plaid, is_admin }
  })
}

/**
 * 添加应用
 * @param aid
 * @param addon_name
 * @param plaid
 * @returns {AxiosPromise}
 */
export function addPlatformAddon(aid, addon_name, plaid) {
  return request({
    url: '/platform/addon/addPlatformAddon',
    method: 'post',
    data: { aid, addon_name, plaid }
  })
}

export function getPlatFormAddonListByAddon(page = 0, size = 10, search) {
  return request({
    url: '/platform/addon/getPlatFormAddonListByAddon',
    method: 'post',
    data: { page, size, search }
  })
}
